<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2019-12-18
 * Time: 10:12
 */

namespace app\api\controller\v1;

use app\api\model\System as SystemModel;
use think\facade\Request;

class System
{
    /**
     * 获取系统信息
     * @auth('信息设置','总管理员')
     */
    public function getSystem()
    {
        return SystemModel::where('id',1)->find();
    }

    /**
     * @validate('CheckSystem')
     * 修改系统信息
     */
    public function updateSystem()
    {
        $put = Request::put();
        $SystemModel = new SystemModel();
        $SystemModel->allowField(true)->save($put,['id' => 1]);
        return writeJson(202, [], '修改成功！');
    }
}